<!DOCTYPE>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>name</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
          page. However, you can choose any other skin. Make sure you
          apply the skin class to the body tag so the changes take effect. -->
    <link rel="stylesheet" href="/css/skin-blue.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->


    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">

<div class="wrapper">

    <header class="main-header">
        <a href="" class="logo">
            <span class="logo-lg"><b>后台</b>管理</span>
        </a>
        <nav class="navbar navbar-static-top" role="navigation">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">按钮</span>
            </a>
        </nav>
    </header>
    <aside class="main-sidebar">

        <section class="sidebar">
            <!--侧边栏-->
            <ul class="sidebar-menu" data-widget="tree">
                <li class="active"><a href="#"><i class="fa fa-link"></i> <span>用户起名审核</span></a></li>
            </ul>
        </section>
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">

            <table width="100%" border="1" cellspacing="1" cellpadding="0" >

                <tr>
                    <td width="5%" align="center">序号</td>
                    <td width="25%" align="center">名字</td>
                    <td width="25%" align="center">起名时间</td>
                    <td width="10%" align="center">状态</td>
                    <td width="20%" align="center">审核</td>
                </tr>
                <#list names as being>
                <form>
                    <tr>
                        <td width="5%" align="center">${being.id}</td>
                        <td width="25%" align="center">${being.name}</td>
                        <td width="25%" align="center">${being.add_time?string('yyyy-MM-dd HH:mm:ss')}</td>
                        <#if being.status=="0" ><td width="25%" align="center">审核中</td></#if>
                        <td width="20%" align="center">
                            <a href="javascript:void(0)" onclick="sendPassStatus(${being.id})">通过</a>&nbsp&nbsp&nbsp&nbsp
                            <a href="javascript:void(0)" onclick="sendRejectStatus(${being.id})" >驳回</a>
                        </td>
                    </tr>
                </form>
                </#list>
            </table>
    </div>

    <script>
        function sendPassStatus(id) {
            // $("#trId").children("td").eq(0).text(}
            // alert(document.getElementById("pass").parent("td").parent("tr"));tr
            // alert(document.getElementById("taa").getAttributeNode("tr").childNodes[0].valueOf())
           //  alert(document.getElementById("taa").children[0].innerHTML);
            var examineNameParams =
                    {"status":"1", //这是你要传给后台的data值
                       "id":id
                    }
            $.ajax({
                type: "POST",
                url: "http://localhost:8092/examine/updateNameStatus",
                data: JSON.stringify(examineNameParams),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function(data) {
                    window.location.reload();//刷新当前页面
                },
                failure: function(errMsg) {
                }
            });
        }
    </script>

    <script>
            function sendRejectStatus(id) {
                var examineNameParams =
                        {"status":"2", //这是你要传给后台的data值
                            "id":id
                        }
                $.ajax({
                    type: "POST",
                    url: "http://localhost:8092/examine/updateNameStatus",
                    data: JSON.stringify(examineNameParams),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(data) {
                        window.location.reload();//刷新当前页面
                    },
                    failure: function(errMsg) {
                    }
                });
            }
    </script>

<#--<div class="col-md-12 column">-->
        <#--<ul class="pagination pull-right">-->
        <#--<#if currentPage lte 1>-->
            <#--<li class="disabled"><a href="#">上一页</a></li>-->
        <#--<#else>-->
            <#--<li><a href="/grocery/groceryinfo?page=${currentPage - 1}&pageSize=${pageSize}">上一页</a></li>-->
        <#--</#if>-->

        <#--<#list 1..grocery.getTotalPages() as index>-->
            <#--<#if currentPage == index>-->
                <#--<li class="disabled"><a href="#">${index}</a></li>-->
            <#--<#else>-->
                <#--<li><a href="/grocery/groceryinfo?page=${index}&pageSize=${pageSize}">${index}</a></li>-->
            <#--</#if>-->
        <#--</#list>-->

        <#--<#if currentPage gte grocery.getTotalPages()>-->
            <#--<li class="disabled"><a href="#">下一页</a></li>-->
        <#--<#else>-->
            <#--<li><a href="/grocery/groceryinfo?page=${currentPage + 1}&pageSize=${pageSize}">下一页</a></li>-->
        <#--</#if>-->
        <#--</ul>-->
    <#--</div>-->

    <!-- jQuery 3 -->
    <script src="/js/jquery.min.js"></script>
    <!-- Bootstrap 3.3.7 -->
    <script src="/js/bootstrap.min.js"></script>
    <!-- AdminLTE App -->
    <script src="/js/adminlte.min.js"></script>

</div>
</body>
</html>